package com.crusinnovation.unitTest.comparator;

import junit.framework.JUnit4TestAdapter;

import org.junit.Test;

import com.cyrusinnovation.test.comparator.LastNameDescending;
import com.cyrusinnovation.test.record.PersonRecord;

/**
 * Sorted by LastName descending
 * @author Al
 *
 */

public class LastNameDescendingTest extends RecordComparatorTestRunner{
	
	@Test
	public void testCompare() {
		PersonRecord r1 = new PersonRecord();
		PersonRecord r2 = new PersonRecord();
		setComparator(new LastNameDescending());
		
		r1.setLastName("A");
		r2.setLastName("B");
		runCompareToTest(r2,r1,"A>B"); //A>B
		
		r1.setLastName("a");
		runCompareToTest(r2,r1,"a>B"); //a>B

		r2.setLastName("b");
		runCompareToTest(r2,r1,"a>b"); //a>b

		r1.setLastName("A");
		runCompareToTest(r2,r1,"A>b"); //A>b

	}
	
	public static junit.framework.Test suite() { 
	    return new JUnit4TestAdapter(LastNameDescendingTest.class); 
	}

}
